<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/libs/element-plus/index.css">
    <link rel="stylesheet" href="/libs/index.css">
</head>
<style>
    [v-cloak]{
        display: none;
    }
    body{
        /*background-color: #FFFFFF;*/
    }
    .wid{
        width: 20%;
    }
    .wenzi-class{
        font-size: 25px;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
<body>
<div id="app" v-cloak>
    <el-button @click="logout" type="primary" v-if="tc">退出</el-button>
    <div class="flex-column">
        <div class="flex-column flex-content-center flex-item-center">
            <div class="wid">
                <img v-if="mini_program_code" :src="mini_program_code" style="width: 100%;height: auto">
            </div>
            <div class="wenzi-class">小程序下单二维码</div>
            <div class="wid">
                <img v-if="qr_code" :src="qr_code" style="width: 100%;height: auto">
            </div>
            <div class="wenzi-class">解锁二维码</div>
        </div>
    </div>

</div>

<script src="/libs/vue/vue.js"></script>
<script src="/libs/element-plus/index.full.js"></script>
<script>
    const {  createApp} = Vue
    var app = createApp({
        data() {
            return {
                tc:false,
                mini_program_code:"",
                qr_code:""
            }
        },
        created(){

        },
        methods: {
            logout(){
                console.log(pywebview)
                pywebview.api.nameclose()
            },
            opennewweb(){
                window.location.href = '/html/ces.html'
            }
        }
    })
    app.use(ElementPlus)
    const root  = app.mount('#app')
function test(bol){
        console.log(bol)
        // console.log(app)
        // console.log(root)
    root.tc =  bol
    // app._instance.proxy
}
window.addEventListener("pywebviewready", function (event) {
    pywebview.api.set_windows_transparency()
})
    function get_response(response){
        console.log(typeof response)
        for(var i in  response){
            console.log(i,response[i])
            if(i == "mini_program_code"){
                root.mini_program_code = response[i]
            }
            if(i == "qr_code"){
                root.qr_code = response[i]
            }
        }
        // if(response.mini_program_code){
        //     console.log(response.mini_program_code)
        // }
        // if(data.mini_program_code){
        //     root.mini_program_code = data.mini_program_code
        // }
        // if(data.qr_code){
        //     root.qr_code = data.qr_code
        // }
    }
// addEventListener("pywebview", function (event) {
//     console.log(999999)
//     pywebview.api.set_windows_transparency()
// })
</script>
</body>
</html>